﻿<Window 
    x:Class="JsonVisualizer.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Internal="clr-namespace:JsonVisualizer.Internal"
    Title="JsonVisualizer - microparser.codeplex.com" 
    MinHeight="480"
    MinWidth="640"
    Background="Black"
    Foreground="White"
    FontFamily="Consolas"
    FontSize="18"
    Hyperlink.Click="OnHyperLinkClicked"
    >
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Copy"  Executed="OnCopy"/>
        <CommandBinding Command="ApplicationCommands.Paste" Executed="OnPaste "/>
    </Window.CommandBindings>
    <Grid x:Name="Main" Margin="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="8"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid
            Grid.Row="0"
            >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="8"/>
                <ColumnDefinition Width="80"/>
                <ColumnDefinition Width="4"/>
                <ColumnDefinition Width="32"/>
                <ColumnDefinition Width="4"/>
                <ColumnDefinition Width="32"/>
            </Grid.ColumnDefinitions>                
            
            <Internal:WatermarkTextBox
                Grid.Column="0"
                x:Name="JsonInput"
                AcceptsReturn="true"
                VerticalAlignment="Top"
                MaxLines="6"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                WatermarkText="Enter JSON here..."
                />

            <Button
                Grid.Column="2"
                Content="Copy"
                VerticalAlignment="Top"
                Height="32"
                Command="ApplicationCommands.Copy"
                />

            <Button
                Grid.Column="4"
                Content="+"
                VerticalAlignment="Top"
                Height="32"
                Click="OnClickZoomIn"
                />
            
            <Button
                Grid.Column="6"
                Content="-"
                VerticalAlignment="Top"
                Height="32"
                Click="OnClickZoomOut"
                />
        </Grid>
        <ScrollViewer
            Grid.Row="2"
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"
            IsTabStop="false"
            >
            <ContentControl 
                x:Name="JsonOutput"
                IsTabStop="false"
                >

                <TextBlock
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    >
                    <Run 
                        Text="> JsonVisualizer"
                        FontSize="64"
                        Foreground="Purple"
                        />
                   <LineBreak/>
                   <LineBreak/>
                   <LineBreak/>
                   <Span FontSize="15" Foreground="#666">
                      <Run
                         Text="JsonVisualizer is built using"
                        />
                      <Hyperlink
                        NavigateUri="http://microparser.codeplex.com"
                        Foreground="DodgerBlue"
                        >
                           <Run Text="MicroParser"/>
                      </Hyperlink>
                      <Run
                         Text="parser combinator library"
                        />
                   </Span>
                </TextBlock>
                
            </ContentControl>
        </ScrollViewer>        
    </Grid>
</Window>
